using System;
using System.Collections.Generic;
using GameStateManagement.GravityWorld;
using GameStateManagement.Model.Physics;
using GameStateManagement.View.Rendering;
using Microsoft.Xna.Framework;

namespace GameStateManagement.Model.Entities.MapParsing
{
    class MapLoader
    {
        /// <summary>
        /// Generates entities from a given file.
        /// </summary>
        /// <param name="fileName">Name of file.</param>
        /// <returns></returns>
        public static GravityMap GenerateMap(String fileName)
        {
            var map = new GravityMap
                          {
                              BonusPickups = new List<StaticEntity>(),
                              Obstacles = new List<StaticEntity>(),
                              ForceFields = new List<PhysicsForceField>(),
                              Decorations = new List<Renderable>(),
                              StartPosition = new Vector2(100, 100),
                              TargetPosition = new Vector2(150, 700)
                          };

            map.ForceFields.Add(new PhysicsForceField
            {
                Behaviour = FieldBehaviour.Pulling,
                Position = new Vector2(200, 450),
                Range = 1500,
                Scale = new Vector2(1, 1),
                Name = "BigRedForceField",
                TextureName = "red_ball",
                Mass = 10000000000000.0F,
                Color = Color.White
            });

            map.BackgroundTextureName = "night_sky";

            return map;
        }
    }
}
